package mqq;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import mqq.model.DecisionLinesEvent;
import mqq.view.Application;

/** 
 * Class that prompts the user for M and N and launches the GUI
 * @author mqq
 */
public class Main {
	/** Prompts the user for M and N via command line and launches the GUI */
	public static void main(String[] args) {
		try {		
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			System.out.println("Please enter the number of lines (3 - 8):");
			int numLines = Integer.parseInt(br.readLine());
			if (numLines < 3 || numLines > 8) {
				System.out.println("ERROR: Number out of bound!");
				System.exit(1);
			}
			System.out.println("Please enter the number of rounds (3 - 8):");
			int numRounds = Integer.parseInt(br.readLine());
			if (numRounds < 3 || numRounds > 8) {
				System.out.println("ERROR: Number out of bound!");
				System.exit(1);
			}
			DecisionLinesEvent m = new DecisionLinesEvent(numRounds, numLines);
			Application app = new Application(m);
			app.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
